import Vue from 'vue'
import Router from 'vue-router'

const ConstellationQuery = () =>
    import ('@/components/query')


Vue.use(Router)

const router = new Router({
    mode: 'hash',
    routes: [{
        path: '/query',
        name: 'query',
        component: ConstellationQuery,
        meta: {
            title: '星座查询'
        }
    }, {
        path: '/',
        redirect: '/query'
    }]
})

//过滤登录态
router.beforeEach((to, from, next) => {
    if (to.meta.title) {
        document.title = to.meta.title
    }
    next()
})
export default router;